summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-05-16 16:06:30 +0200
committerGitHub <noreply@github.com>2023-05-16 16:06:30 +0200
commit47c5c37bed53c4dd67842cd7e87e3d8bf5adb291 (patch)
tree2571ef0f6838c888d16b52d50e9ee04c0f93a985
parentMerge pull request #10107 from grimkor/allow-fully-customised-hotkeys (diff)
parentUse the rendertarget format of the correct RT rather than the first valid (diff)
downloadyuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar.gz
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar.bz2
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar.lz
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar.xz
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.tar.zst
yuzu-47c5c37bed53c4dd67842cd7e87e3d8bf5adb291.zip
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 64bd2f6a5..8d3a9736b 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -348,25 +348,12 @@ void RasterizerVulkan::Clear(u32 layer_count) {
const u32 color_attachment = regs.clear_surface.RT;
if (use_color && framebuffer->HasAspectColorBit(color_attachment)) {
- VkClearValue clear_value;
- bool is_integer = false;
- bool is_signed = false;
- size_t int_size = 8;
- for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; ++i) {
- const auto& this_rt = regs.rt[i];
- if (this_rt.Address() == 0) {
- continue;
- }
- if (this_rt.format == Tegra::RenderTargetFormat::NONE) {
- continue;
- }
- const auto format =
- VideoCore::Surface::PixelFormatFromRenderTargetFormat(this_rt.format);
- is_integer = IsPixelFormatInteger(format);
- is_signed = IsPixelFormatSignedInteger(format);
- int_size = PixelComponentSizeBitsInteger(format);
- break;
- }
+ const auto format =
+ VideoCore::Surface::PixelFormatFromRenderTargetFormat(regs.rt[color_attachment].format);
+ bool is_integer = IsPixelFormatInteger(format);
+ bool is_signed = IsPixelFormatSignedInteger(format);
+ size_t int_size = PixelComponentSizeBitsInteger(format);
+ VkClearValue clear_value{};
if (!is_integer) {
std::memcpy(clear_value.color.float32, regs.clear_color.data(),
regs.clear_color.size() * sizeof(f32));